#include <stdio.h>
#include <stdlib.h>
#include "nuclei_sdk_soc.h"

#define APB_SRAM_ADDRESS 0xE0070000

int main(void)
{
    for(int32_t i =0 ; i <10 ; i++){
        REG32(APB_SRAM_ADDRESS+i*4) = 0x5a5a5a5+i;
    }

    for(int32_t j =0 ; j <10 ; j++){
        if(REG32(APB_SRAM_ADDRESS+j*4) != (0x5a5a5a5+j)){
            printf("APB_SRAM access error:address :%x\r\n",APB_SRAM_ADDRESS+j);
            return -1;
        }
    }

    #ifdef CFG_SIMULATION
        pass_fail_simulation(1);
    #endif 

    printf("APB_SRAM access PASS\r\n");
}